import 'package:flutter/services.dart';

class GetNetworkState {
  static var eventChannel = const EventChannel('get_network_state_events');
  static Stream get stream => eventChannel.receiveBroadcastStream();
  static var channel = const MethodChannel("get_network_state");
  static Future<dynamic> getNetWorkState() async {
    return await channel.invokeMethod("getNetWorkState");
  }

  static Future<dynamic> startMonitoring() async {
    return await channel.invokeMethod("startMonitoring");
  }

  static Future<dynamic> stopMonitoring() async {
    return await channel.invokeMethod("stopMonitoring");
  }

  static Future<dynamic> init() async {
    return await channel.invokeMethod("init");
  }
}
